separator: Remove priv pointer
authorTimm Bäder <mail@baedert.org>
Wed, 7 Mar 2018 19:37:00 +0000 (20:37 +0100)
committerTimm Bäder <mail@baedert.org>
Wed, 7 Mar 2018 19:42:32 +0000 (20:42 +0100)
gtk/gtkseparator.c
gtk/gtkseparator.h

index f723c694e0f417a72127fd2b25e082505e1a3626..e968bb4a3120caaa3ca20a2464befaaca9a6d5ef 100644 (file)
@@ -48,6 +48,7 @@
  */
 
 
+typedef struct _GtkSeparatorPrivate GtkSeparatorPrivate;
 struct _GtkSeparatorPrivate
 {
   GtkOrientation orientation;
@@ -72,14 +73,14 @@ gtk_separator_set_property (GObject      *object,
                             GParamSpec   *pspec)
 {
   GtkSeparator *separator = GTK_SEPARATOR (object);
-  GtkSeparatorPrivate *private = separator->priv;
+  GtkSeparatorPrivate *priv = gtk_separator_get_instance_private (separator);
 
   switch (prop_id)
     {
     case PROP_ORIENTATION:
-      if (private->orientation != g_value_get_enum (value))
+      if (priv->orientation != g_value_get_enum (value))
         {
-          private->orientation = g_value_get_enum (value);
+          priv->orientation = g_value_get_enum (value);
           _gtk_orientable_set_style_classes (GTK_ORIENTABLE (object));
           gtk_widget_queue_resize (GTK_WIDGET (object));
           g_object_notify_by_pspec (object, pspec);
@@ -98,12 +99,12 @@ gtk_separator_get_property (GObject    *object,
                             GParamSpec *pspec)
 {
   GtkSeparator *separator = GTK_SEPARATOR (object);
-  GtkSeparatorPrivate *private = separator->priv;
+  GtkSeparatorPrivate *priv = gtk_separator_get_instance_private (separator);
 
   switch (prop_id)
     {
     case PROP_ORIENTATION:
-      g_value_set_enum (value, private->orientation);
+      g_value_set_enum (value, priv->orientation);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -114,8 +115,9 @@ gtk_separator_get_property (GObject    *object,
 static void
 gtk_separator_init (GtkSeparator *separator)
 {
-  separator->priv = gtk_separator_get_instance_private (separator);
-  separator->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
+  GtkSeparatorPrivate *priv = gtk_separator_get_instance_private (separator);
+
+  priv->orientation = GTK_ORIENTATION_HORIZONTAL;
 
   gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
 
index 1ce4130ea6c2ab3146da2f95a871a3e678980c48..1f129c8d0a71d8e50e83fe7c54e847054b2d4878 100644 (file)
@@ -44,14 +44,11 @@ G_BEGIN_DECLS
 
 
 typedef struct _GtkSeparator              GtkSeparator;
-typedef struct _GtkSeparatorPrivate       GtkSeparatorPrivate;
 typedef struct _GtkSeparatorClass         GtkSeparatorClass;
 
 struct _GtkSeparator
 {
-  GtkWidget widget;
-
-  GtkSeparatorPrivate *priv;
+  GtkWidget parent_instance;
 };
 
 struct _GtkSeparatorClass